package com.yuandian.api.management.feign;

import com.yuandian.api.customer_perception.vo.SearchOptionVo;
import com.yuandian.api.management.entity.ConfBusiness;
import com.yuandian.bpm.common.core.util.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 说明：远程调用选项接口服务
 * @Author zfsn
 * @Date 2023/3/14 16:06
 */
@FeignClient(contextId = "RemoteBusinessService", value = "bpm-management")
public interface RemoteBusinessService {

	/**
	 * 通过业务编码查询数据
	 *
	 * @param businessCode 业务编码
	 * @return 通用返回对象
	 */
	@GetMapping("/business/getBusiness/{businessCode}")
	R<ConfBusiness> getBusinessByBusinessCode(@PathVariable("businessCode") String businessCode);

	/**
	 * 通过系统id获取改系统下的业务数
	 * @param systemIds 主键
	 * @return 通用返回对象
	 */
	@GetMapping("/business/getBusinessCountBySystemIds/{systemIds}")
	R<List<Map<String, Integer>>> getBusinessCountBySystemIds(@PathVariable("systemIds") List<Integer> systemIds);

	/**
	 * 通过系统id查询已确认的关键业务列表
	 * @param systemId 业务vo
	 * @return 通用返回对象
	 */
	@GetMapping("/business/queryKeyBusinessBySystemId/{systemId}")
	R<List<ConfBusiness>> queryKeyBusinessBySystemId(@PathVariable(value = "systemId") Integer systemId);

	/**
	 * 查询所有已确认的关键业务列表
	 * @return 通用返回对象
	 */
	@GetMapping("/business/queryKeyBusinessBySystemId")
	R<List<ConfBusiness>> queryKeyBusiness();

	/**
	 * 根据各种过滤条件查询business 数据
	 * @param confBusiness 业务vo
	 * @return 通用返回对象
	 */
	@PostMapping("/business/getBusiness")
	R<List<ConfBusiness>> getBusiness(ConfBusiness confBusiness);

	/**
	 * 根据步骤编码查询所诉业务
	 * @return 通用返回对象
	 */
	@PostMapping("/business/queryBusinessCodeListByStepCode")
	R<List<String>> queryBusinessCodeListByStepCode(List<String> stepCodes);

	/**
	 * 根据步骤编码查询所诉业务
	 * @return 通用返回对象
	 */
	@GetMapping("/business/queryBusinessBySystemId/{systemId}")
	R<List<SearchOptionVo>> queryBusinessBySystemId(@PathVariable(value = "systemId") Integer systemId);
}
